Optimal. Leaf size=279 \[ \frac{\left (8 a^2 A b+16 a^3 B+2 a b^2 B-A b^3\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{8 a^{5/2} d}+\frac{\left (8 a^2 A-2 a b B+A b^2\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{\sqrt{a-i b} (B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d}+\frac{\sqrt{a+i b} (-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d}-\frac{(6 a B+A b) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.16793, antiderivative size = 279, normalized size of antiderivative = 1., number of steps used = 14, number of rules used = 8, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.242, Rules used = {3608, 3649, 3653, 3539, 3537, 63, 208, 3634} \[ \frac{\left (8 a^2 A b+16 a^3 B+2 a b^2 B-A b^3\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{8 a^{5/2} d}+\frac{\left (8 a^2 A-2 a b B+A b^2\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{\sqrt{a-i b} (B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d}+\frac{\sqrt{a+i b} (-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d}-\frac{(6 a B+A b) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3608
Rule 3649
Rule 3653
Rule 3539
Rule 3537
Rule 63
Rule 208
Rule 3634
Rubi steps
\begin{align*} \int \cot ^4(c+d x) \sqrt{a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx &=-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}-\frac{1}{3} \int \frac{\cot ^3(c+d x) \left (\frac{1}{2} (-A b-6 a B)+3 (a A-b B) \tan (c+d x)+\frac{5}{2} A b \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx\\ &=-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}+\frac{\int \frac{\cot ^2(c+d x) \left (-\frac{3}{4} \left (8 a^2 A+A b^2-2 a b B\right )-6 a (A b+a B) \tan (c+d x)-\frac{3}{4} b (A b+6 a B) \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{6 a}\\ &=\frac{\left (8 a^2 A+A b^2-2 a b B\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}-\frac{\int \frac{\cot (c+d x) \left (\frac{3}{8} \left (8 a^2 A b-A b^3+16 a^3 B+2 a b^2 B\right )-6 a^2 (a A-b B) \tan (c+d x)-\frac{3}{8} b \left (8 a^2 A+A b^2-2 a b B\right ) \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{6 a^2}\\ &=\frac{\left (8 a^2 A+A b^2-2 a b B\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}-\frac{\int \frac{-6 a^2 (a A-b B)-6 a^2 (A b+a B) \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx}{6 a^2}-\frac{\left (8 a^2 A b-A b^3+16 a^3 B+2 a b^2 B\right ) \int \frac{\cot (c+d x) \left (1+\tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{16 a^2}\\ &=\frac{\left (8 a^2 A+A b^2-2 a b B\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}+\frac{1}{2} ((a-i b) (A-i B)) \int \frac{1+i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx+\frac{1}{2} ((a+i b) (A+i B)) \int \frac{1-i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx-\frac{\left (8 a^2 A b-A b^3+16 a^3 B+2 a b^2 B\right ) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\tan (c+d x)\right )}{16 a^2 d}\\ &=\frac{\left (8 a^2 A+A b^2-2 a b B\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}+\frac{(i (a-i b) (A-i B)) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}-\frac{((i a-b) (A+i B)) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d}-\frac{\left (8 a^2 A b-A b^3+16 a^3 B+2 a b^2 B\right ) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{8 a^2 b d}\\ &=\frac{\left (8 a^2 A b-A b^3+16 a^3 B+2 a b^2 B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{8 a^{5/2} d}+\frac{\left (8 a^2 A+A b^2-2 a b B\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}-\frac{((a-i b) (A-i B)) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}-\frac{((a+i b) (A+i B)) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}\\ &=\frac{\left (8 a^2 A b-A b^3+16 a^3 B+2 a b^2 B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{8 a^{5/2} d}-\frac{\sqrt{a-i b} (i A+B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d}+\frac{\sqrt{a+i b} (i A-B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d}+\frac{\left (8 a^2 A+A b^2-2 a b B\right ) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{8 a^2 d}-\frac{(A b+6 a B) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{12 a d}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{3 d}\\ \end{align*}
Mathematica [B] time = 6.39186, size = 564, normalized size = 2.02 \[ \frac{2 b^4 \left (-\frac{(a A-b B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{2 a^{3/2} b^3}-\frac{3 (a B+A b) \left (\frac{\tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2}}-\frac{\cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a b}\right )}{8 a b^2}+\frac{5 A \left (\frac{3 \left (\frac{\tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2}}-\frac{\cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a b}\right )}{a}+\frac{2 \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{a b^2}\right )}{48 b}+\frac{(a B+A b) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} b^4}+\frac{\left (a A b-a \sqrt{-b^2} B-A \sqrt{-b^2} b+b^2 (-B)\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-\sqrt{-b^2}}}\right )}{2 b^4 \sqrt{-b^2} \sqrt{a-\sqrt{-b^2}}}-\frac{\left (a A b+a \sqrt{-b^2} B+A \sqrt{-b^2} b+b^2 (-B)\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+\sqrt{-b^2}}}\right )}{2 \left (-b^2\right )^{5/2} \sqrt{a+\sqrt{-b^2}}}-\frac{(a B+A b) \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{4 a b^4}+\frac{(a A-b B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{2 a b^4}-\frac{A \cot ^3(c+d x) \sqrt{a+b \tan (c+d x)}}{6 b^4}\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 2.46, size = 118304, normalized size = 424. \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (A + B \tan{\left (c + d x \right )}\right ) \sqrt{a + b \tan{\left (c + d x \right )}} \cot ^{4}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]